With the development of computer technologies and communications technologies, a network structure in an actual application is increasingly complex, which causes a switch or a router to possibly receive routing information sent by the switch or the router, thereby causing generation of a routing loop and a waste of link bandwidth resources.
In order to avoid generation of a routing loop, in the prior art, layer-3 routing uses a route poison reverse manner, multiprotocol label switching (MPLS for short) uses an MPLS label manner, and transparent interconnection of lots of links (TRILL) uses a virtual nickname manner to implement horizontal network segmentation. A principle of the horizontal network segmentation is: in a process of transmitting routing information, routing information that is received by a router from an interface is not allowed to be sent back from the interface, thereby avoiding generation of a routing loop to a certain degree.
In a network, a multi-homed connection-based networking structure is widely used to improve network reliability. The following provides a detailed description by taking a dual-homed connection as an example. FIG. 1 is a schematic diagram of a network connection in a multi-homed scenario. As shown in FIG. 1, when an internal network and an external public network are interconnected, one switch or router of the internal network is connected to a gateway 1 and a gateway 2 by using two links separately (namely, connected to the gateway 1 and gateway 2 in a dual-homed manner). Using the network split horizon principle in the prior art may prevent the gateway 1 from sending routing information back to the switch or router. However, the switch or router may still receive, through the gateway 2, routing information that is sent by the switch or router to the gateway 1, which still causes generation of a routing loop and a waste of link bandwidth resources. Therefore, it can be seen that the split horizon principle in the prior art cannot avoid generation of a routing loop in a multi-homed scenario.